package com.cmsky.open.security.model;

import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.util.*;

import com.cmsky.open.core.base.*;
import com.cmsky.open.core.util.*;

import cn.org.rapid_framework.util.*;
import cn.org.rapid_framework.web.util.*;
import cn.org.rapid_framework.page.*;
import cn.org.rapid_framework.page.impl.*;

import com.cmsky.open.security.model.*;
import com.cmsky.open.security.dao.*;
import com.cmsky.open.security.manager.*;
import com.cmsky.open.security.vo.query.*;

/**
 * @author jandyfish email:jandyfish(a)gmail.com
 * @version 1.0
 * @since 1.0
 */


public class RoleActionsInfo extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "RoleActionsInfo";
	public static final String ALIAS_ID = "关联编号";
	public static final String ALIAS_ACTION_ID = "功能编号";
	public static final String ALIAS_ROLE_ID = "角色编号";
	
	//date formats
	
	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
    /**
     * 关联编号       db_column: id 
     */	
	
	private java.lang.Integer id;
    /**
     * 功能编号       db_column: actionId 
     */	
	@NotNull 
	private java.lang.Integer actionId;
    /**
     * 角色编号       db_column: roleId 
     */	
	@NotNull 
	private java.lang.Integer roleId;
	//columns END

	public RoleActionsInfo(){
	}

	public RoleActionsInfo(
		java.lang.Integer id
	){
		this.id = id;
	}

	public void setId(java.lang.Integer value) {
		this.id = value;
	}
	
	public java.lang.Integer getId() {
		return this.id;
	}
	public void setActionId(java.lang.Integer value) {
		this.actionId = value;
	}
	
	public java.lang.Integer getActionId() {
		return this.actionId;
	}
	public void setRoleId(java.lang.Integer value) {
		this.roleId = value;
	}
	
	public java.lang.Integer getRoleId() {
		return this.roleId;
	}
	
	private RolesInfo rolesInfo;
	
	public void setRolesInfo(RolesInfo rolesInfo){
		this.rolesInfo = rolesInfo;
	}
	
	public RolesInfo getRolesInfo() {
		return rolesInfo;
	}
	
	private ActionsInfo actionsInfo;
	
	public void setActionsInfo(ActionsInfo actionsInfo){
		this.actionsInfo = actionsInfo;
	}
	
	public ActionsInfo getActionsInfo() {
		return actionsInfo;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("ActionId",getActionId())
			.append("RoleId",getRoleId())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof RoleActionsInfo == false) return false;
		if(this == obj) return true;
		RoleActionsInfo other = (RoleActionsInfo)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.append(getActionId(),other.getActionId())
			.append(getRoleId(),other.getRoleId())
			.isEquals();
	}
}

